package com.quotemanager.ui;

import java.awt.GridLayout;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class Product {
		JFrame productFrame = null;
		JLabel nameLabel = null;
		JTextField nameField = null;
		JPanel namePanel = null;
		
		JLabel typeLabel = null;
		JComboBox typeCombo = null;
		JPanel typePanel = null;
		
		JLabel brandLabel = null;
		JComboBox brandCombo = null;
		JPanel brandPanel = null;
		
		JLabel priceLabel = null;
		JTextField priceField = null;
		JPanel pricePanel = null;
		
		JLabel statusLabel = null;
		JComboBox statusCombo = null;
		JPanel statusPanel = null;
		
		JButton submitButton = null;
		JButton cancelButton = null;
		JPanel buttonPanel = null;
		
		Product(){
			nameLabel = new JLabel("Product Name");
			nameField = new JTextField(10);
			typeLabel = new JLabel("Product Type");
			typeCombo = new JComboBox();
			brandLabel =  new JLabel("Brand");
			brandCombo = new JComboBox();
			priceLabel = new JLabel("Price");
			priceField = new JTextField(10);
			priceField.setText("0.00");
			statusLabel = new JLabel("Status");
			statusCombo = new JComboBox();
			submitButton = new JButton("Submit");
			cancelButton = new JButton("Cancel");
			typeCombo.addItem("--select--");
			brandCombo.addItem("--select--");
			statusCombo.addItem("--select--");
			statusCombo.addItem("Active");
			statusCombo.addItem("Inactive");
			
			namePanel = new JPanel();
			namePanel.setLayout(new GridLayout(1,2));
			namePanel.add(nameLabel);
			namePanel.add(nameField);
			
			typePanel = new JPanel();
			typePanel.setLayout(new GridLayout(1,2));
			typePanel.add(typeLabel);
			typePanel.add(typeCombo);
			
			brandPanel = new JPanel();
			brandPanel.setLayout(new GridLayout(1,2));
			brandPanel.add(brandLabel);
			brandPanel.add(brandCombo);
			
			pricePanel = new JPanel();
			pricePanel.setLayout(new GridLayout(1,2));
			pricePanel.add(priceLabel);
			pricePanel.add(priceField);
			
			statusPanel = new JPanel();
			statusPanel.setLayout(new GridLayout(1,2));
			statusPanel.add(statusLabel);
			statusPanel.add(statusCombo);
			
			buttonPanel = new JPanel();
			buttonPanel.setLayout(new GridLayout(1,2));
			buttonPanel.add(submitButton);
			buttonPanel.add(cancelButton);
			
			JPanel mainPanel = new JPanel();
			mainPanel.setLayout(new BoxLayout(mainPanel,BoxLayout.Y_AXIS));
			mainPanel.add(namePanel);
			mainPanel.add(typePanel);
			mainPanel.add(brandPanel);
			mainPanel.add(pricePanel);
			mainPanel.add(statusPanel);
			mainPanel.add(buttonPanel);
			
			productFrame = new JFrame("Product");
			productFrame.getContentPane().add(mainPanel);
			productFrame.pack();
			productFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			productFrame.setVisible(true);
			
			
		}
		public static void main(String[] args){
			new Product();
		}
}
